<!DOCTYPE html>
<html lang="zh-CN">
<head><meta name="generator" content="Hexo 3.8.0">

    <!--[if lt IE 9]>
        <style>body {display: none; background: none !important} </style>
        <meta http-equiv="Refresh" Content="0; url=//outdatedbrowser.com/" />
    <![endif]-->

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="author" content="qq">



<meta name="description" content="开始——创建一个场景">
<meta name="keywords" content="JavaScript,Three.js">
<meta property="og:type" content="article">
<meta property="og:title" content="初学three.js（一）">
<meta property="og:url" content="http://huaqq.github.io/2019/04/04/初学three-js（一）/index.html">
<meta property="og:site_name" content="Lionqq&#39;s Blog">
<meta property="og:description" content="开始——创建一个场景">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2019-04-04T12:22:12.458Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="初学three.js（一）">
<meta name="twitter:description" content="开始——创建一个场景">

<link rel="apple-touch-icon" href="/apple-touch-icon.png">


    <link rel="alternate" href="/atom.xml" title="Lionqq&#39;s Blog" type="application/atom+xml">



    <link rel="shortcut icon" href="/bitbug_favicon.ico">



    <link href="//cdn.bootcss.com/animate.css/3.5.1/animate.min.css" rel="stylesheet">



    <link href="//cdn.bootcss.com/fancybox/2.1.5/jquery.fancybox.min.css" rel="stylesheet">



    <script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
    <link href="//cdn.bootcss.com/pace/1.0.2/themes/blue/pace-theme-minimal.css" rel="stylesheet">


<link rel="stylesheet" href="/css/style.css">



<link href="//cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">


<title>初学three.js（一） | Lionqq&#39;s Blog</title>

<script src="//cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"></script>

<script>
    var yiliaConfig = {
        fancybox: true,
        animate: true,
        isHome: false,
        isPost: true,
        isArchive: false,
        isTag: false,
        isCategory: false,
        fancybox_js: "//cdn.bootcss.com/fancybox/2.1.5/jquery.fancybox.min.js",
        scrollreveal: "//cdn.bootcss.com/scrollReveal.js/3.1.4/scrollreveal.min.js",
        search: true
    }
</script>


    <script>
        yiliaConfig.jquery_ui = [true, "//cdn.bootcss.com/jqueryui/1.10.4/jquery-ui.min.js", "//cdn.bootcss.com/jqueryui/1.10.4/css/jquery-ui.min.css"];
    </script>



    <script> yiliaConfig.rootUrl = "\/";</script>





    <script>
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "//hm.baidu.com/hm.js?9403eb8c3e1afbd49d6eafbef0cf66e5";
            var s = document.getElementsByTagName("script")[0]; 
            s.parentNode.insertBefore(hm, s);
        })();
    </script>


</head></html>
<body>
  <div id="container">
    <div class="left-col">
    <div class="overlay"></div>
<div class="intrude-less">
    <header id="header" class="inner">
        <a href="/" class="profilepic">
            <img src="/img/tx.png" class="animated zoomIn">
        </a>
        <hgroup>
          <h1 class="header-author"><a href="/">qq</a></h1>
        </hgroup>

        
        <p class="header-subtitle">仙人抚我顶，结发受长生</p>
        

        
            <form id="search-form">
            <input type="text" id="local-search-input" name="q" placeholder="search..." class="search form-control" autocomplete="off" autocorrect="off" searchonload="">
            <i class="fa fa-times" onclick="resetSearch()"></i>
            </form>
            <div id="local-search-result"></div>
            <p class="no-result">No results found <i class="fa fa-spinner fa-pulse"></i></p>
        


        
            <div id="switch-btn" class="switch-btn">
                <div class="icon">
                    <div class="icon-ctn">
                        <div class="icon-wrap icon-house" data-idx="0">
                            <div class="birdhouse"></div>
                            <div class="birdhouse_holes"></div>
                        </div>
                        <div class="icon-wrap icon-ribbon hide" data-idx="1">
                            <div class="ribbon"></div>
                        </div>
                        
                        <div class="icon-wrap icon-link hide" data-idx="2">
                            <div class="loopback_l"></div>
                            <div class="loopback_r"></div>
                        </div>
                        
                        
                    </div>
                    
                </div>
                <div class="tips-box hide">
                    <div class="tips-arrow"></div>
                    <ul class="tips-inner">
                        <li>菜单</li>
                        <li>标签</li>
                        
                        <li>友情链接</li>
                        
                        
                    </ul>
                </div>
            </div>
        

        <div id="switch-area" class="switch-area">
            <div class="switch-wrap">
                <section class="switch-part switch-part1">
                    <nav class="header-menu">
                        <ul>
                        
                            <li><a href="/">主页</a></li>
                        
                            <li><a href="/archives/">所有文章</a></li>
                        
                            <li><a href="/tags/">标签云</a></li>
                        
                            <li><a href="/about/">关于我</a></li>
                        
                        </ul>
                    </nav>
                    <nav class="header-nav">
                        <ul class="social">
                            
                                <a class="fa Email" href="/1076817937@qq.com" title="Email"></a>
                            
                                <a class="fa GitHub" href="#" title="GitHub"></a>
                            
                                <a class="fa RSS" href="/atom.xml" title="RSS"></a>
                            
                        </ul>
                    </nav>
                </section>
                
                
                <section class="switch-part switch-part2">
                    <div class="widget tagcloud" id="js-tagcloud">
                        <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/C-C/">C/C++</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Java/">Java</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/JavaScript/">JavaScript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Spring/">Spring</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Three-js/">Three.js</a></li></ul>
                    </div>
                </section>
                
                
                
                <section class="switch-part switch-part3">
                    <div id="js-friends">
                    
                      <a class="main-nav-link switch-friends-link" href="https://hexo.io">Hexo</a>
                    
                      <a class="main-nav-link switch-friends-link" href="https://pages.github.com/">GitHub</a>
                    
                      <a class="main-nav-link switch-friends-link" href="http://moxfive.xyz/">MOxFIVE</a>
                    
                    </div>
                </section>
                

                
            </div>
        </div>
    </header>                
</div>
    </div>
    <div class="mid-col">
      <nav id="mobile-nav">
      <div class="overlay">
          <div class="slider-trigger"></div>
          <h1 class="header-author js-mobile-header hide"><a href="/" title="回到主页">qq</a></h1>
      </div>
    <div class="intrude-less">
        <header id="header" class="inner">
            <a href="/" class="profilepic">
                <img src="/img/tx.png" class="animated zoomIn">
            </a>
            <hgroup>
              <h1 class="header-author"><a href="/" title="回到主页">qq</a></h1>
            </hgroup>
            
            <p class="header-subtitle">仙人抚我顶，结发受长生</p>
            
            <nav class="header-menu">
                <ul>
                
                    <li><a href="/">主页</a></li>
                
                    <li><a href="/archives/">所有文章</a></li>
                
                    <li><a href="/tags/">标签云</a></li>
                
                    <li><a href="/about/">关于我</a></li>
                
                <div class="clearfix"></div>
                </ul>
            </nav>
            <nav class="header-nav">
                        <ul class="social">
                            
                                <a class="fa Email" target="_blank" href="/1076817937@qq.com" title="Email"></a>
                            
                                <a class="fa GitHub" target="_blank" href="#" title="GitHub"></a>
                            
                                <a class="fa RSS" target="_blank" href="/atom.xml" title="RSS"></a>
                            
                        </ul>
            </nav>
        </header>                
    </div>
    <link class="menu-list" tags="标签" friends="友情链接" about="关于我">
</nav>
      <div class="body-wrap"><article id="post-初学three-js（一）" class="article article-type-post" itemscope="" itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2019/04/04/初学three-js（一）/" class="article-date">
      <time datetime="2019-04-04T10:46:39.000Z" itemprop="datePublished">2019-04-04</time>
</a>


    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      初学three.js（一）
    </h1>
  

      </header>
      
      <div class="article-info article-info-post">
        

        
    <div class="article-tag tagcloud">
        <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/JavaScript/">JavaScript</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Three-js/">Three.js</a></li></ul>
    </div>

        <div class="clearfix"></div>
      </div>
      
    
    <div class="article-entry" itemprop="articleBody">
      
          
        <h1 id="开始创建一个场景"><a class="markdownIt-Anchor" href="#开始创建一个场景"></a> 开始——创建一个场景</h1>
<a id="more"></a>
<h2 id="开始之前"><a class="markdownIt-Anchor" href="#开始之前"></a> 开始之前</h2>
<p>先创建一个html文件，添加两个样式。</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">body</span> &#123; <span class="attribute">margin</span>: <span class="number">0</span>; &#125;</span><br><span class="line"><span class="selector-tag">canvas</span> &#123; <span class="attribute">width</span>: <span class="number">100%</span>; <span class="attribute">height</span>: <span class="number">100%</span> &#125;</span><br></pre></td></tr></table></figure>
<p><code>body</code>是一种HTML标签，用来定义文档的主体，一个HTML文件只能有一个<code>&lt;body&gt;</code>标签。<code>margin</code>属性用来设置外边距，值可以是百分比、长度值（px）。</p>
<p><code>canvas</code>是H5的图形标签，可以作为图形容器，也可以用于定义图形。在这里设置它的属性为百分百来占满窗口。</p>
<p><code>&lt;Script&gt;</code>标签执行一个外部的js脚本。</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html&gt;</span><br><span class="line">	&lt;head&gt;</span><br><span class="line">		&lt;meta charset=utf<span class="number">-8</span>&gt;</span><br><span class="line">		&lt;title&gt;My first three.js app&lt;<span class="regexp">/title&gt;</span></span><br><span class="line"><span class="regexp">		&lt;style&gt;</span></span><br><span class="line"><span class="regexp">			body &#123; margin: 0; &#125;</span></span><br><span class="line"><span class="regexp">			canvas &#123; width: 100%; height: 100% &#125;</span></span><br><span class="line"><span class="regexp">		&lt;/</span>style&gt;</span><br><span class="line">	&lt;<span class="regexp">/head&gt;</span></span><br><span class="line"><span class="regexp">	&lt;body&gt;</span></span><br><span class="line"><span class="regexp">		&lt;script src="https:/</span><span class="regexp">/cdnjs.cloudflare.com/</span>ajax/libs/three.js/r79/three.min.js<span class="string">"&gt;&lt;/script&gt;</span></span><br><span class="line"><span class="string">		&lt;script&gt;</span></span><br><span class="line"><span class="string">			// JS代码从这里开始写</span></span><br><span class="line"><span class="string">		&lt;/script&gt;</span></span><br><span class="line"><span class="string">	&lt;/body&gt;</span></span><br><span class="line"><span class="string">&lt;/html&gt;</span></span><br></pre></td></tr></table></figure>
<h2 id="创建场景"><a class="markdownIt-Anchor" href="#创建场景"></a> 创建场景</h2>
<p>我们需要创建三个对象来绘制图像：场景、相机、渲染器。</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> scene = <span class="keyword">new</span> THREE.Scene();</span><br><span class="line"><span class="keyword">var</span> camera = <span class="keyword">new</span> THREE.PerspectiveCamera( <span class="number">75</span>, <span class="built_in">window</span>.innerWidth / <span class="built_in">window</span>.innerHeight, <span class="number">0.1</span>, <span class="number">1000</span> );</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> renderer = <span class="keyword">new</span> THREE.WebGLRenderer();</span><br><span class="line">renderer.setSize( <span class="built_in">window</span>.innerWidth, <span class="built_in">window</span>.innerHeight );</span><br><span class="line"><span class="built_in">document</span>.body.appendChild( renderer.domElement );</span><br></pre></td></tr></table></figure>
<p>关于相机对象，这里使用的是透视相机</p>
<ul>
<li>第一个参数表示视场角的大小</li>
<li>第二个参数表示宽高比，类似于我们看视频可以设置画面16:9之类的比例</li>
<li>最后两个参数表示与屏幕近、远的距离，在这个距离内物体才会被渲染，比如当一个物体与相机的距离比近值还要小，比远值还要大，它就不会被渲染，不会被这个相机看到</li>
</ul>
<p>关于渲染器对象，这里设置了它渲染的一个范围，只有在这个范围内，才会被渲染。当你拉伸窗口之后，它只有刷新后才会适应你的新窗口，考虑到这一点，你可以在<code>setSize()</code>的最后加一个<code>false</code>参数，渲染的范围就会自动适应你的窗口的变化。</p>
<p>最后一行是把这个渲染器像图片一样添加到HTML文档中。</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> geometry = <span class="keyword">new</span> THREE.BoxGeometry(<span class="number">1</span>,<span class="number">1</span>,<span class="number">1</span>);</span><br><span class="line"><span class="keyword">var</span> material = <span class="keyword">new</span> THREE.MeshBasicMaterial(&#123;<span class="attr">color</span>:<span class="number">0xff0000</span>&#125;);</span><br><span class="line"><span class="keyword">var</span> cube = <span class="keyword">new</span> THREE.Mesh(geometry, material);</span><br><span class="line">scene.add(cube);</span><br><span class="line">camera.position.z=<span class="number">5</span>;</span><br></pre></td></tr></table></figure>
<p>这里创建了一个立方体<code>BoxGeometry</code> 对象，三个参数分别表示长宽高</p>
<p>它还有三个隐藏参数可以设置，分别表示长宽高的分段，在网格基础材质对象中使用线模式渲染<code>wireframe:true</code>可以看到</p>
<p>最后new一个网格对象，它包括了基本的物体，还有材质</p>
<h2 id="渲染场景"><a class="markdownIt-Anchor" href="#渲染场景"></a> 渲染场景</h2>
<p>如果只有上面的代码还不足以看到任何东西，因为我们还没有引入渲染这个过程。</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">animate</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">	requestAnimationFrame( animate );</span><br><span class="line">	renderer.render( scene, camera );</span><br><span class="line">&#125;</span><br><span class="line">animate();</span><br></pre></td></tr></table></figure>
<p>这段代码创建了一个过程，每当我们刷新屏幕，它都会重新渲染。使用<code>requestAnimationFrame(animate )</code> 的意义在于，当我们不看这个网页的时候，它就会暂停这个渲染过程，替我们节省资源。</p>
<h2 id="给物体添加动画"><a class="markdownIt-Anchor" href="#给物体添加动画"></a> 给物体添加动画</h2>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cube.rotation.x += <span class="number">0.01</span>;</span><br><span class="line">cube.rotation.y += <span class="number">0.01</span>;</span><br></pre></td></tr></table></figure>
<p>给物体添加x、y轴上的旋转动画。</p>
<p>以上就是我们的第一个three.js应用，最后的代码为:</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html&gt;</span><br><span class="line">	&lt;head&gt;</span><br><span class="line">		&lt;meta charset=utf<span class="number">-8</span>&gt;</span><br><span class="line">		&lt;title&gt;My first three.js app&lt;<span class="regexp">/title&gt;</span></span><br><span class="line"><span class="regexp">		&lt;style&gt;</span></span><br><span class="line"><span class="regexp">			body &#123; margin: 0; &#125;</span></span><br><span class="line"><span class="regexp">			canvas &#123; width: 100%; height: 100% &#125;</span></span><br><span class="line"><span class="regexp">		&lt;/</span>style&gt;</span><br><span class="line">	&lt;<span class="regexp">/head&gt;</span></span><br><span class="line"><span class="regexp">	&lt;body&gt;</span></span><br><span class="line"><span class="regexp">		&lt;script src="https:/</span><span class="regexp">/cdnjs.cloudflare.com/</span>ajax/libs/three.js/r79/three.min.js<span class="string">"&gt;&lt;/script&gt;</span></span><br><span class="line"><span class="string">		&lt;script&gt;</span></span><br><span class="line"><span class="string">			// Our Javascript will go here.</span></span><br><span class="line"><span class="string">      var scene = new THREE.Scene();</span></span><br><span class="line"><span class="string">      var camera = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 0.1, 500 );</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">      var renderer = new THREE.WebGLRenderer();</span></span><br><span class="line"><span class="string">      renderer.setSize( 0.5*window.innerWidth, 0.5*window.innerHeight);</span></span><br><span class="line"><span class="string">      document.body.appendChild( renderer.domElement );</span></span><br><span class="line"><span class="string">      var geometry = new THREE.BoxGeometry( 1, 1, 2);</span></span><br><span class="line"><span class="string">      var material = new THREE.MeshBasicMaterial( &#123; color: 0xff0000 &#125; );</span></span><br><span class="line"><span class="string">      var cube = new THREE.Mesh( geometry, material );</span></span><br><span class="line"><span class="string">      scene.add( cube );</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">      camera.position.z = 5;</span></span><br><span class="line"><span class="string">      function animate() &#123;</span></span><br><span class="line"><span class="string">	       requestAnimationFrame( animate );</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">				cube.rotation.x += 0.01;</span></span><br><span class="line"><span class="string">				cube.rotation.y += 0.01;</span></span><br><span class="line"><span class="string">	       renderer.render( scene, camera );</span></span><br><span class="line"><span class="string">       &#125;</span></span><br><span class="line"><span class="string">       animate();</span></span><br><span class="line"><span class="string">		&lt;/script&gt;</span></span><br><span class="line"><span class="string">	&lt;/body&gt;</span></span><br><span class="line"><span class="string">&lt;/html&gt;</span></span><br></pre></td></tr></table></figure>

      
    </div>
    
  </div>
  
    
    <div class="copyright">
        <p><span>本文标题:</span><a href="/2019/04/04/初学three-js（一）/">初学three.js（一）</a></p>
        <p><span>文章作者:</span><a href="/" title="回到主页">qq</a></p>
        <p><span>发布时间:</span>2019-04-04, 18:46:39</p>
        <p><span>最后更新:</span>2019-04-04, 20:22:12</p>
        <p>
            <span>原始链接:</span><a class="post-url" href="/2019/04/04/初学three-js（一）/" title="初学three.js（一）">http://huaqq.github.io/2019/04/04/初学three-js（一）/</a>
            <span class="copy-path" data-clipboard-text="原文: http://huaqq.github.io/2019/04/04/初学three-js（一）/　　作者: qq" title="点击复制文章链接"><i class="fa fa-clipboard"></i></span>
            <script> var clipboard = new Clipboard('.copy-path'); </script>
        </p>
        <p>
            <span>许可协议:</span><i class="fa fa-creative-commons"></i> <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/" title="CC BY-NC-SA 4.0 International" target="_blank">"署名-非商用-相同方式共享 4.0"</a> 转载请保留原文链接及作者。
        </p>
    </div>



    <nav id="article-nav">
        
        
            <div id="article-nav-older" class="article-nav-title">
                <a href="/2019/04/02/Java/">
                    Java复习
                </a>
            </div>
        
    </nav>

  
</article>

    <div id="toc" class="toc-article">
        <strong class="toc-title">文章目录</strong>
        
            <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#开始创建一个场景"><span class="toc-number">1.</span> <span class="toc-text"> 开始——创建一个场景</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#开始之前"><span class="toc-number">1.1.</span> <span class="toc-text"> 开始之前</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#创建场景"><span class="toc-number">1.2.</span> <span class="toc-text"> 创建场景</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#渲染场景"><span class="toc-number">1.3.</span> <span class="toc-text"> 渲染场景</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#给物体添加动画"><span class="toc-number">1.4.</span> <span class="toc-text"> 给物体添加动画</span></a></li></ol></li></ol>
        
    </div>
    <style>
        .left-col .switch-btn,
        .left-col .switch-area {
            display: none;
        }
        .toc-level-3 i,
        .toc-level-3 ol {
            display: none !important;
        }
    </style>

    <input type="button" id="tocButton" value="隐藏目录" title="点击按钮隐藏或者显示文章目录">

    <script>
        yiliaConfig.toc = ["隐藏目录", "显示目录", !!"false"];
    </script>



    
<div class="share">
    
        <div class="bdsharebuttonbox">
            <a href="#" class="fa fa-twitter bds_twi" data-cmd="twi" title="分享到推特"></a>
            <a href="#" class="fa fa-weibo bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
            <a href="#" class="fa fa-qq bds_sqq" data-cmd="sqq" title="分享给 QQ 好友"></a>
            <a href="#" class="fa fa-files-o bds_copy" data-cmd="copy" title="复制网址"></a>
            <a href="#" class="fa fa fa-envelope-o bds_mail" data-cmd="mail" title="通过邮件分享"></a>
            <a href="#" class="fa fa-weixin bds_weixin" data-cmd="weixin" title="生成文章二维码"></a>
            <a href="#" class="fa fa-share-alt bds_more" data-cmd="more"></a>
        </div>
        <script>
            window._bd_share_config={
                "common":{"bdSnsKey":{},"bdText":"初学three.js（一）　| Lionqq's Blog　","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
        </script>
    

    
</div>







    




    <div class="scroll" id="post-nav-button">
        
            <a href="/" title="回到主页"><i class="fa fa-home"></i></a>
        

        <a title="文章列表"><i class="fa fa-bars"></i><i class="fa fa-times"></i></a>

        
            <a href="/2019/04/02/Java/" title="下一篇: Java复习">
                <i class="fa fa-angle-right"></i>
            </a>
        
    </div>

    <ul class="post-list"><li class="post-list-item"><a class="post-list-link" href="/2019/04/04/初学three-js（一）/">初学three.js（一）</a></li><li class="post-list-item"><a class="post-list-link" href="/2019/04/02/Java/">Java复习</a></li><li class="post-list-item"><a class="post-list-link" href="/2019/03/04/Spring——Hello/">Spring——Hello</a></li><li class="post-list-item"><a class="post-list-link" href="/2018/11/16/三维网格平面参数化(一)/">三维网格平面参数化(一)</a></li></ul>




    <script>
        
    </script>
</div>
      <footer id="footer">
    <div class="outer">
        <div id="footer-info">
            <div class="footer-left">
                <i class="fa fa-copyright"></i> 
                2016-2019 qq
            </div>
            <div class="footer-right">
                <a href="http://hexo.io/" target="_blank" title="快速、简洁且高效的博客框架">Hexo</a>  Theme <a href="https://github.com/MOxFIVE/hexo-theme-yelee" target="_blank" title="简而不减 Hexo 双栏博客主题  v3.5">Yelee</a> by MOxFIVE <i class="fa fa-heart animated infinite pulse"></i>
            </div>
        </div>
        
            <div class="visit">
                
                    <span id="busuanzi_container_site_pv" style="display:none">
                        <span id="site-visit" title="本站到访数"><i class="fa fa-user" aria-hidden="true"></i><span id="busuanzi_value_site_uv"></span>
                        </span>
                    </span>
                
                
                    <span>| </span>
                
                
                    <span id="busuanzi_container_page_pv" style="display:none">
                        <span id="page-visit" title="本页阅读量"><i class="fa fa-eye animated infinite pulse" aria-hidden="true"></i><span id="busuanzi_value_page_pv"></span>
                        </span>
                    </span>
                
            </div>
        
    </div>
</footer>
    </div>
    
<script data-main="/js/main.js" src="//cdn.bootcss.com/require.js/2.2.0/require.min.js"></script>





<div class="scroll" id="scroll">
    <a href="#" title="返回顶部"><i class="fa fa-arrow-up"></i></a>
    <a href="#comments" onclick="load$hide();" title="查看评论"><i class="fa fa-comments-o"></i></a>
    <a href="#footer" title="转到底部"><i class="fa fa-arrow-down"></i></a>
</div>
<script>
    // Open in New Window
    
        var oOpenInNew = {
            
            
            
            
            
            
             archives: ".archive-article-title", 
             miniArchives: "a.post-list-link", 
            
             friends: "#js-friends a", 
             socail: ".social a" 
        }
        for (var x in oOpenInNew) {
            $(oOpenInNew[x]).attr("target", "_blank");
        }
    
</script>

<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
</script>
  </div>
</body>
</html>